Method for real time optimization and parallel computing of model prediction control based on computing chart

ABSTRACT

The disclosure relates to a method for real time optimization and parallel computing of model prediction control based on a computing chart, comprising the following steps: building a prediction model of a system state amount and building a target function of a system; building a parallel computing architecture for model prediction control of a prediction model and the target function and employing a triggering parallel computing method by the parallel computing architecture to synchronously compute the prediction model and the target function; and solving and computing a gradient with a manner of back propagation and using a gradient descent method to optimize a control amount of the system and realize real time optimal control of the system. Compared with the prior art, the present disclosure greatly improves a computing efficiency, ensures real time property of a model prediction controller, and extends application fields of model prediction control.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of China application serialno. 202110344736.0, filed on Mar. 31, 2021. The entirety of theabove-mentioned patent application is hereby incorporated by referenceherein and made a part of this specification.

BACKGROUND Technical Field

The present invention relates to the technical field of real timeoptimization for model prediction control and in particular, relates toa method for real time optimization and parallel computing of modelprediction control based on a computing chart.

Description of Related Art

Since model prediction control is featured by rolling optimization,feedback adjustment and explicit considerations of a system restraint,thus increasing application fields, especially a rapid and dynamicsystem (such as electronic power, mechatronics engineering, automobileelectronics and the like) urgently need model prediction control toprocess its complicated restraint optimization problem and improve acontrol property. However, a current control action of model predictioncontrol is obtained by solving an optimal control problem of an openloop in a limited time domain through a model at each sampling moment,relating to numerous computing amount and time. Therefore, largecomputing amount for online optimization of model prediction control isa main bottleneck of limiting its application.

In the recent years, many valuable achievements have been made for studyof rapid computing for prediction control. In a control policy aspect, adesign is optimized and a solution process of prediction control issimplified through a controller structure, which effectively reduce acomputing complexity. However, the existing methods are mostly serialcomputing policies in a time domain, with limited speed upgrading space.In an aspect of solving an optimization problem, the existing methodsmostly adopt a standard or improved planning algorithm for iterativecomputing of solution. However, direct solution of a nonlinearoptimization problem relates to a large number of complicated computingof gradient and a computing of a matrix inversion, resulting in a verylarge computing amount. Meanwhile, a general iterative logic foroptimization is rather complicated and it belongs to a serial iterativealgorithm mostly. The characteristic determines that they are notequipped with a large parallel accelerating space, such that a speed ofeach iteration can be accelerated as far as possible. This point dependson increasing speed of a processor to a great extent and createsdisadvantages for parallel implementation of hardware.

SUMMARY

The objective of the present invention is to overcome the existingdefect of the prior art by providing a method for real time optimizationand parallel computing of model prediction control based on a computingchart.

The objective of the present invention can be realized through thefollowing technical solution:

A method for real time optimization and parallel computing of modelprediction control based on a computing chart comprises the followingsteps:

S1: building a prediction model of a system state amount and building atarget function of a system;

S2: building a parallel computing architecture for model predictioncontrol of a prediction model and the target function and employing atriggering parallel computing method by the parallel computingarchitecture to synchronously compute the prediction model and thetarget function; and

S3: solving and computing a gradient with a manner of back propagationand using a gradient descent method to optimize a control amount of thesystem and realize real time optimal control of the system.

Preferably, in the parallel computing architecture for model predictioncontrol in the step S2, a symbol indicating that solution of theprediction model and the target function in a present step has beencompleted is used as a symbol of starting a prediction computing at anext step, thereby realizing parallel computing of the prediction modeland the target function.

Preferably, a recurrence relationship between the prediction model andthe target function is:

$\begin{matrix}{i = 0} & {J_{0} = {\sum\limits_{i = 0}^{N - 1}{\Delta u_{k + {i{❘k}}}^{T}R\Delta u_{{{k + i}❘}k}}}} & {x_{{k + 1}❘k} = {f\left( {x_{k{❘k}},u_{{k❘}k}} \right)}} \\{i = 1} & {J_{1} = {J_{0} + {x_{k + {1{❘k}}}^{T}{Qx}_{{{k + 1}❘}k}}}} & {x_{{k + 2}❘k} = {f\left( {x_{k + {1{❘k}}},u_{{{k + 1}❘}k}} \right)}} \\\text{ } & \vdots & \text{ } \\{i = {N - 1}} & {J_{N - 1} = {J_{N - 2} + {x_{k + N - {1{❘k}}}^{T}{Qx}_{{{k + N - 1}❘}k}}}} & {x_{{k + N}❘k} = {f\left( {x_{k + N - {1{❘k}}},u_{{{k + N - 1}❘}k}} \right)}} \\{i = N} & {J = {J_{N - 1} + {x_{k + {N{❘k}}}^{T}{Px}_{{{k + N}❘}k}}}} & \text{ }\end{matrix}$

-   -   wherein J is a target function, ƒ is a prediction model of a        system, x_(k+i|k) is a system state amount in step i at moment k        and        _(k+i|k) is a system control amount in step i at moment k.

Preferably, the step S4 specifically comprises:

S41: building a plurality of computing nodes, and setting one storageunit for each computing note, the storage unit storing a relatedcomputing parameter;

S42: obtaining a gradient of a target function for an input amount basedon back propagation according to the computing parameter in theplurality of computing nodes; and

S43: using a gradient descent method to optimize a control amount of thesystem, and obtaining an optimal control sequence, thereby realizingparallel prediction control of the system.

Preferably, the step S43 specifically comprises:

-   -   using a gradient descent method to optimize a control amount:        _(k|k),        _(k−1|k) . . .        _(k+N−1|k),    -   wherein        _(k|k),        _(k+1|k) . . .        _(k+N−1|k) is a control amount in step 0, 1 . . . N−1 within        moment k,    -   completing an optimization process when one of optimization        conditions is satisfied, thereby obtaining an optimal control        sequence U*^(k):        U* _(k)=[        *_(k|k),        *_(k+1|k) . . .        *_(k+N−1|k)],    -   wherein        *_(k|k),        *_(k+1|k) . . .        *_(k+N−1|k) is a desired value of a control amount in step 0, 1        . . . N−1 within moment k,    -   using a first element        *_(k|k) in the obtained optimal control sequence U*_(k) as a        control amount at moment k, and a new control sequence        consisting of a zero element added after an element subsequent        to the first element as an initial value of a prediction control        input matrix at moment k+1, i.e. U_(0|k+1)=[        *_(k+1|k),        *_(k+2|k) . . .        *_(k+N−1|k),0], and ending an prediction and optimization        process at moment k, and    -   repeating the above steps to complete a prediction and        optimization process at moment k+1.

Preferably, a computing formula of the optimal control sequence is:

$\begin{matrix}{u_{k❘k}^{*} = {u_{{k - 1}❘{k - 1}}^{*} - {\frac{\partial J}{\partial u_{k❘k}}\Delta t}}} \\{u_{{k + 1}❘k}^{*} = {u_{k❘k}^{*} - {\frac{\partial J}{\partial u_{{k + 1}❘k}^{*}}\Delta t}}} \\ \vdots \\{u_{{k + N - 1}❘k}^{*} = {u_{{k + N - 2}❘k}^{*} - {\frac{\partial J}{\partial u_{{k + 1}❘k}^{*}}\Delta t}}}\end{matrix}$

-   -   wherein        *_(k⇄i|k) is a desired value of a control amount of step i at        moment k,        *_(k−1|k−1) is an optimal control amount of the previous moment        and Δt is a control step size.

Preferably, the optimization condition is that a difference valuebetween a target function of a present iterative step size and a targetfunction of a previous step is smaller than a set value or reacheslimited optimization times or a changing amount of a target function is0.

Preferably, the system is a vehicle model and the prediction model is avehicle path and speed tracking model.

Preferably, the control objective of the vehicle path and speed trackingmodel is:

-   -   rapidly and accurately tracking a vehicle longitudinal velocity        v_(s) and a lateral displacement Y, and setting a control time        domain and a prediction time domain both as N and a target        function as

${\min\limits_{U}J} = {{\sum\limits_{i = 0}^{N - 1}\left( {{x_{i}^{T}{Qx}_{i}} + {u_{i}^{T}{Ru}_{i}}} \right)} + {x_{N}^{T}{Px}_{N}}}$

-   -   wherein x_(i) is a state amount of step i at a present moment,        _(i) is a system control amount of step i at the present moment,        Q is a positive weight matrix, P is a positive terminal penalty        matrix and R is a positive control amount penalty matrix.

Preferably, the target function is decomposed as follows upon beingcomputed:

$\begin{matrix}{J_{0} = {{g(U)} = {\sum\limits_{i = 0}^{N - 1}{u_{i}^{T}{Ru}_{i}}}}} \\{J_{i} = {{h\left( {y_{i},J_{i - 1}} \right)} = {J_{i - 1} + {\left( {y_{i} - y_{r}} \right)^{T}{Q\left( {y_{i} - y_{r}} \right)}}}}} \\{{= {\left( {x_{ji} - x_{jr}} \right)^{T}{Q\left( {x_{ji} - x_{jr}} \right)}}},{j = 1},6,{i = 1},2,\ldots,N}\end{matrix}$

-   -   wherein g and h are respectively a decomposition computing        function.

Compared with the prior art, the present invention proposes anarchitecture for parallel computing with a forward solution and a targetfunction solution based on a multi-instruction and multi-data parallelcomputing concept and in considering coupling of parallel task datacombined with a triggering parallel computing manner, sequence of datacomputing number is ensured and the objective of shortening thecomputing time is finally achieved. Meanwhile, based on the concept ofthe computing chart, the architecture uses a process of solving aprediction state with a forward propagation as a node, and the nodecomprises an input amount, an output amount and a partial derivative ofthe input amount to the output amount. Through the manner of backpropagation, the partial derivative of input and output stored in thenode is taken out in order and multiplied to compute a gradient.Generally, a dimension of a control sequence matrix in model predictioncontrol is higher than a dimension of a target function matrix.Therefore, relative to forward computing, inverse computing can reduceoperation times to further improve operation efficiency greatly, ensurereal time property of a model prediction controller and expandapplication fields of model prediction control, such that the inversecomputing is highly practical and applicable.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow chart of the present invention;

FIG. 2 is a computing model diagram of a recursive process for a futurestate of a prediction system of the present invention;

FIG. 3 is a diagram for a parallel computing architecture of the presentinvention;

FIG. 4 is a schematic diagram of a computing manner for forwardpropagation;

FIG. 5 is a schematic diagram of a computing manner for backpropagation;

FIG. 6 is a partial computing chart of a gradient descent method;

FIG. 7 is a curve diagram of a reference speed;

FIG. 8 is a curve diagram of path tracking;

FIG. 9 is a curve diagram of speed tracking;

FIG. 10 is an error curve diagram of displacement tracking; and

FIG. 11 is an error curve diagram of speed tracking.

DESCRIPTION OF THE EMBODIMENTS

The present invention is described in detail below with reference to theaccompanying drawings and specific embodiments. It should be noted thatthe following descriptions of embodiments are merely illustrative insubstance, as the present invention does not intend to limit itsapplicable objects or functions and the present invention does not limitthe following embodiments:

Embodiments

A method for real time optimization and parallel computing of modelprediction control based on a computing chart, as shown in FIG. 1 ,comprises the following steps:

S1: building a prediction model of a system state amount and building atarget function of a system;

In the embodiment, the following control system is considered:

A system discrete kinetic equation is: x_(k+1)=ƒ(x_(k),

_(k));

A system output amount is equal to a system state amount, i.e. y=χ;

A system desired output is a zero matrix, i.e. y^(r)=0;

A control objective is to minimize a quadratic sum of a prediction errorand a quadratic sum of a changing rate in a control sequencesimultaneously; and

A control time domain is equal to a prediction time domain, as N.

According to the above system combined with a chart model concept, thecomputing model of the recursive process for the future state of thefollowing prediction system as shown in FIG. 2 can be obtained, whereinx_(k|k) is a system amount at moment k,

_(k|k) is an input amount at moment k, ƒ is a recurrence function (aprediction model), J is a target function to be optimized, P is a weightmatrix of a terminal, Q is a state weight matrix and R is a weightmatrix of a control amount.

A recurrence relationship between the prediction model and the targetfunction is:

$\begin{matrix}{i = 0} & {J_{0} = {\sum\limits_{i = 0}^{N - 1}{\Delta u_{k + {i{❘k}}}^{T}R\Delta u_{{{k + i}❘}k}}}} & {x_{{k + 1}❘k} = {f\left( {x_{k{❘k}},u_{{k❘}k}} \right)}} \\{i = 1} & {J_{1} = {J_{0} + {x_{k + {1{❘k}}}^{T}{Qx}_{{{k + 1}❘}k}}}} & {x_{{k + 2}❘k} = {f\left( {x_{k + {1{❘k}}},u_{{{k + 1}❘}k}} \right)}} \\\text{ } & \vdots & \text{ } \\{i = {N - 1}} & {J_{N - 1} = {J_{N - 2} + {x_{k + N - {1{❘k}}}^{T}{Qx}_{{{k + N - 1}❘}k}}}} & {x_{{k + N}❘k} = {f\left( {x_{k + N - {1{❘k}}},u_{{{k + N - 1}❘}k}} \right)}} \\{i = N} & {J = {J_{N - 1} + {x_{k + {N{❘k}}}^{T}{Px}_{{{k + N}❘}k}}}} & \text{ }\end{matrix}$

-   -   wherein J is a target function, ƒ is a prediction model of a        system, x_(k+i|k) is a system state amount in step i at moment k        and        _(k+i|k) is a system control amount in step i at moment k.

S2: building a parallel computing architecture for model predictioncontrol of a prediction model and the target function and employing atriggering parallel computing method by the parallel computingarchitecture to synchronously compute the prediction model and thetarget function. In the parallel computing architecture for modelprediction control in the step S2, a symbol indicating that solution ofthe prediction model and the target function in a present step has beencompleted is used as a symbol of starting a prediction computing at anext step, thereby realizing parallel computing of the prediction modeland the target function.

According to the above forward computing process, a computing program isprogrammed. Each node built corresponds to a storage unit of a singlechip microcontroller and comprises the following five parts. With a nodeat x_(k+N−1|k) as an example, when forward computing is finished, outputof each node and a partial derivative corresponding to the node arestored in a corresponding storage space.

$\begin{matrix}x_{{k + N - 1}❘k} \\u_{{k + N - 1}❘k} \\{x_{{k + N}❘k} = {f\left( {x_{{k + N - 1}❘k},u_{{k + N - 1}❘k}} \right)}} \\{\frac{\partial f}{\partial x}❘\left( {x_{{k + N - 1}❘k},u_{{k + N - 1}❘k}} \right)} \\{\frac{\partial f}{\partial u}❘\left( {x_{{k + N - 1}❘k},u_{{k + N - 1}❘k}} \right)}\end{matrix}$

In the process of forward recurrence, computing of the target functionis performed synchronously, as shown in FIG. 3 . Since data in paralleltasks is not completely independent, a coupling exists. However, for aprediction process of each step, data is independent. In this regard,the present invention combines a triggering parallel computing manner,i.e. using a symbol indicating that solution of the forward inference instep N (i.e. No. 1 parallel computing content) and the target function(i.e. No. 2 parallel computing content) as a symbol of startingcomputing for prediction in step N+1, so as to ensure sequence of thedata computing number and finally achieve the purpose of the shorteningthe computing time.

S3: solving and computing a gradient with a manner of back propagationand using a gradient descent method to optimize a control amount of thesystem and realize real time optimal control of the system.

Through a calculating gradient of back propagation, i.e. partialderivatives stored correspondingly by needed nodes are taken out inorder and multiplied to obtain a gradient of the target function to theinput amount. Since N control amounts exist in an entire control timedomain, one control amount outputs a control model of a variable. Forforward solution, partial derivatives of the target function to eachinput can only be computed by traversing all nodes N times. For inversesolution, it is only necessary to traverse all nodes once, to thuscalculate the partial derivative of the target function to each input.The solution processes thereof are respectively shown in FIG. 4 and FIG.5 .

The step S3 specifically comprises:

S31: building a plurality of computing nodes, and setting one storageunit for each computing note, the storage unit storing a relatedcomputing parameter;

S32: obtaining a gradient of a target function for an input amount basedon back propagation according to the computing parameter in theplurality of computing nodes; and

S33: using a gradient descent method to optimize a control amount of thesystem, and obtaining an optimal control sequence, thereby realizingparallel prediction control of the system.

The step S33 specifically comprises:

-   -   using a gradient descent method to optimize a control amount:        _(k|k),        _(k+1|k) . . .        _(k+N−1|k),    -   wherein        _(k|k),        _(k+1|k) . . .        _(k+N−1|k) is respectively a control amount in step 0, 1 . . .        N−1 within moment k,    -   completing an optimization process when one of optimization        conditions is satisfied, thereby obtaining an optimal control        sequence U*_(k):        U* _(k)=[        *_(k|k),        *_(k+1|k) . . .        *_(k+N−1|k)],    -   wherein        *_(k|k),        *_(k+1|k) . . .        *_(k+N−1|k) is respectively a desired value of a control amount        in step 0, 1 . . . N−1 within moment k,    -   using a first element        *_(k|k) in the obtained optimal control sequence U*_(k) as a        control amount at moment k, and a new control sequence        consisting of a zero element added after an element subsequent        to the first element as an initial value of a prediction control        input matrix at moment k+1, i.e. U_(0|k+1)=[        *_(k+1|k),        *_(k+2|k) . . .        *_(k+N−1|k), 0], and ending an prediction and optimization        process at moment k, and    -   repeating the above steps to complete a prediction and        optimization process at moment k+1.

A computing formula of the optimal control sequence is:

$\begin{matrix}{u_{k❘k}^{*} = {u_{{k - 1}❘{k - 1}}^{*} - {\frac{\partial J}{\partial u_{k❘k}}\Delta t}}} \\{u_{{k + 1}❘k}^{*} = {u_{k❘k}^{*} - {\frac{\partial J}{\partial u_{{k + 1}❘k}^{*}}\Delta t}}} \\ \vdots \\{u_{{k + N - 1}❘k}^{*} = {u_{{k + N - 2}❘k}^{*} - {\frac{\partial J}{\partial u_{{k + 1}❘k}^{*}}\Delta t}}}\end{matrix}$

-   -   wherein        *_(k+i|k) is a desired value of a control amount of step i at        moment k,        *_(k−1|k−1) is an optimal control amount of the previous moment        and Δt is a control step size.

In the embodiment, the system is a vehicle model, and the predictionmodel is a vehicle path and speed tracking model for parallel computingin considering the following three degrees of freedom (DOFs) vehiclenonlinear model:

$\left\{ \begin{matrix}{{\overset{.}{\upsilon}}_{x} = {{\upsilon_{y}r} + a_{x}}} \\{{\overset{.}{\upsilon}}_{y} = {{\upsilon_{x}r} + \frac{2\left( {C_{f} + C_{r}} \right)\upsilon_{y}}{{m\upsilon}_{x}} + \frac{2{r\left( {{aC}_{f} - {bC}_{r}} \right)}}{m\upsilon_{x}} - {\frac{2C_{f}}{m}\delta_{f}}}} \\{\overset{.}{\varphi} = r} \\{\overset{.}{r} = {\frac{2{\upsilon_{y}\left( {{aC}_{f} - {bC}_{r}} \right)}}{I_{z}\upsilon_{x}} + \frac{2{r\left( {{a^{2}C_{f}} + {b^{2}C_{r}}} \right)}}{I_{z}\upsilon_{x}} - {\frac{2{aC}_{f}}{I_{z}}\delta_{f}}}} \\{\overset{.}{X} = {{\upsilon_{x}\cos\varphi} - {\upsilon_{y}\sin\varphi}}} \\{\overset{.}{Y} = {{\upsilon_{x}\sin\varphi} + {\upsilon_{y}\cos\varphi}}}\end{matrix} \right.$

Wherein v_(x) is a vehicle longitudinal speed; v_(y) is a vehiclehorizontal speed, a_(x) is a longitudinal acceleration, r is a yaw rate,C_(ƒ) is a front wheel cornering stiffness, C_(r) is a rear wheelcornering stiffness, m is a total weight, a,b is a distance from acentroid to a front shaft and a rear shaft, δ_(ƒ) a front wheel steeringangle, I_(x) is a rotational inertia of a vehicle centroid about shaft zand φ is a heading angle of a vehicle.

Therefore, a vehicle continuous nonlinear model can be rewritten as:{dot over (x)}=ƒ(x,

)

-   -   system state prediction (forward propagation).

Firstly, the continuous system models are discretized. In order toimprove discretization accuracy, a three-order three-section Runge-Kuttaformula is used for discretization to obtain a system discrete model.

$\left\{ \begin{matrix}{k_{1} = {T_{s}{f\left( {x_{k},u_{k}} \right)}}} \\{k_{2} = {T_{s}{f\left( {{x_{k} + {\frac{1}{2}k_{1}}},u_{k}} \right)}}} \\{k_{3} = {T_{s}{f\left( {{x_{k} - k_{1} + {2k_{2}}},u_{k}} \right)}}} \\{x_{k + 1} = {x_{k} + {\frac{1}{6}\left( {k_{1} + {4k_{2}} + k_{3}} \right)}}}\end{matrix} \right.$

Then, an initial value is given for control input and it is N in acontrol time domain and a prediction time domain both. Due to adual-input system, the initial value is set as a column vector of row 1in line 2N.U=[

(0)^(T)

(1)^(T) . . .

(N−1)^(T)]^(T)

An initial state is x(0) and state prediction is computed according toformula (7).

The control objective of a vehicle path and speed tracking model is:

-   -   rapidly and accurately tracking a vehicle longitudinal velocity        v_(x) and a lateral displacement Y, and setting a control time        domain and a prediction time domain both as N and a target        function as

${\min\limits_{U}J} = {{\sum\limits_{i = 0}^{N - 1}\left( {{x_{i}^{T}{Qx}_{i}} + {u_{i}^{T}{Ru}_{i}}} \right)} + {x_{N}^{T}{Px}_{N}}}$

-   -   wherein x_(i) is a state amount of step i at a present moment,        is a system control amount of step i at the present moment, Q is        a positive weight matrix, P is a positive terminal penalty        matrix and R is a positive control amount penalty matrix.

The target function is decomposed as follows upon being computed:

$\begin{matrix}{J_{0} = {{g(U)} = {\sum\limits_{i = 0}^{N - 1}{u_{i}^{T}{Ru}_{i}}}}} \\{J_{i} = {{h\left( {y_{i},J_{i - 1}} \right)} = {J_{i - 1} + {\left( {y_{i} - y_{r}} \right)^{T}{Q\left( {y_{i} - y_{r}} \right)}}}}} \\{{= {\left( {x_{ji} - x_{jr}} \right)^{T}{Q\left( {x_{ji} - x_{jr}} \right)}}},{j = 1},6,{i = 1},2,\ldots,N}\end{matrix}$

-   -   wherein g and h are respectively a decomposition computing        function.

According to the computing chart model of FIG. 2 , it is divided into Nlayers and one layer is computed each time upon forward prediction andinverse derivation.

With

$\begin{matrix}{A_{k} = \frac{\partial x_{k + 1}}{\partial x_{k}}} & {and} & {{B_{k} = \frac{\partial x_{k + 1}}{\partial u_{k}}},}\end{matrix}$the following can be computed according to the system discrete model:A _(k) =I+T _(s) A _(c,k)+½T _(s) ² A _(c,k) ²+⅙T _(s) ³ A _(c,k) ³B _(k) =T _(s) B _(c,k)+½T _(s) ² A _(c,k) B _(c,k)+⅙T _(s) ³ A _(c,k) ²B _(c,k)

Wherein A_(c,k) is a Jacobi matrix of ƒ to x at (x_(k),

_(k)) and B_(c,k) is a Jacobi matrix of ƒ to

at (x_(k),

_(k)).

According to the computing chart model of FIG. 2 , a local partialderivative of each layer can be computed in order as follows:

${\frac{\partial J}{\partial x_{N}} = {2x_{N}^{T}P}},{\frac{\partial J}{\partial J_{N - 1}} = 1}$

For the N−1th layer:

${\frac{\partial x_{N}}{\partial x_{N - 1}} = A_{N - 1}},{\frac{\partial x_{N}}{\partial u_{N - 1}} = B_{N - 1}}$${\frac{\partial J_{N - 1}}{\partial x_{N - 1}} = {2x_{N - 1}^{T}B}},{\frac{\partial J_{N - 1}}{\partial J_{N - 2}} = 1}$

-   -   after obtaining the local partial derivative, the following can        be solved according to FIG. 6 and a chain rule:

$\begin{matrix}{\frac{\partial J}{\partial x_{N - 1}} = {{\frac{\partial J}{\partial x_{N}}\frac{\partial x_{N}}{\partial x_{N - 1}}} + {\frac{\partial J}{\partial J_{N - 1}}\frac{\partial J_{N - 1}}{\partial x_{N - 1}}}}} \\{= {{\frac{\partial J}{\partial x_{N}}A_{N - 1}} + {2x_{N - 1}^{T}Q}}}\end{matrix}$ and $\begin{matrix}{\frac{\partial J}{\partial u_{N - 1}} = {{\frac{\partial J}{\partial x_{N}}\frac{\partial x_{N}}{\partial u_{N - 1}}} + {\frac{\partial J}{\partial J_{N - 1}}\frac{\partial J_{N - 1}}{\partial u_{N - 1}}}}} \\{= {{\frac{\partial J}{\partial x_{N}}B_{N - 1}} + {2u_{N - 1}^{T}R}}}\end{matrix}$

It can be seen that

$\frac{\partial J}{\partial x_{N}}$solved at the Nth layer is used for solution of both

${\frac{\partial J}{\partial x_{N - 1}}{and}\frac{\partial J}{\partial u_{N - 1}}},$and the computing of the two does not relate to each other, such that itcan performed in parallel.

With the previous layer similar to the N−1th layer, recurrence can bemade by combining FIG. 2 to obtain

$\frac{\partial J}{\partial x_{i}}$and the needed

$\frac{\partial J}{\partial u_{i}}$

${\frac{\partial J}{\partial x_{i}} = {{\frac{\partial J}{\partial x_{i + 1}}A_{i}} + {2x_{i}^{T}Q}}},{i = 1},2,\ldots,{N - 1}$${\frac{\partial J}{\partial u_{i}} = {{\frac{\partial J}{\partial x_{i + 1}}B_{i}} + {2u_{i}^{T}R}}},{i = 0},1,\ldots,{N - 2}$

To sum up, by inputting formulas of weight matrices R, Q and P, and theJacobi matrix of the system, A_(i) and B_(i) corresponding to the futurex_(i) can be solved according to the prediction state of the Runge-Kuttaformula and solution formulas of A_(k) and B_(k), and computing can beperformed according to the recurrence formula to obtain the gradient ofthe target function to the optimization variable.

${\nabla{J(U)}} = \left\lbrack {\left( \frac{\partial J}{\partial u_{0}} \right)^{T}\left( \frac{\partial J}{\partial u_{1}} \right)^{T}\ldots\left( \frac{\partial J}{\partial u_{N - 1}} \right)^{T}} \right\rbrack^{T}$

Each iteration updates control input along a direction opposite to thegradient.U ^((k+1)) =U ^((k)) −s∇J(U ^((k)))

Simulation Experiment Result

The prediction time domain and the control time domain: N=10 and s=0.01,and weight matrices R=S=0 and P=Q=diag(0.5, 0, 0.2, 0.2, 0, 0.5) aretaken. The reference path y_(ref) to be tracked is:

$y_{ref} = \left\{ \begin{matrix}{0,} & {X_{pre} < {200m}} \\{{3{\sin\left( {\frac{\pi}{100}X_{pre}} \right)}},} & {200 \leqslant X_{pre} < {600m}} \\{0,} & {X_{pre} > {600m}}\end{matrix} \right.$

-   -   wherein X_(pre) is a lateral prediction displacement.

An initial vehicle speed is 15 m/s and a reference speed v_(x,ref) is:

$v_{x,{ref}} = \left\{ \begin{matrix}{25,} & {X_{pre} < {400m}} \\{\sqrt{625 - {2\left( {X_{pre} - 400} \right)}},} & {200 \leqslant X_{pre} < {600m^{dand}\sqrt{625 - {2\left( {X_{pre} - 400} \right)}}} \geqslant 20} \\{20,} & {200 \leqslant X_{pre} < {600m^{dand}\sqrt{625 - {2\left( {X_{pre} - 400} \right)}}} < 20} \\{\sqrt{\left. {400 - X_{pre} - 600} \right)},} & {X_{pre} > {600m^{dand}\sqrt{400 - {2\left( {X_{pre} - 600} \right)}}} \geqslant 15} \\{15,} & {X_{pre} > {600m^{dand}\sqrt{400 - {2\left( {X_{pre} - 600} \right)}}} < 15}\end{matrix} \right.$

The reference speed curve is shown in FIG. 7 and the acceleration at aspeed reducing stage is set as −1 m/s. The result of the vehicle pathand speed tracking curve is shown in FIGS. 8 and 9 and the displacementand speed tracking error curve is shown in FIGS. 10 and 11 .

The embodiments are merely illustrative and do not limit the scope ofthe present invention. These embodiments can also be implemented inother various manners and various omissions, replacements andmodifications can be made without departing from the scope of thetechnical concept of the present invention.

What is claimed is:
 1. A method for a real time optimization and aparallel computing of a model prediction control based on a computingchart, wherein the method comprises the following steps: S1: building aprediction model of a system state amount and building a target functionof a system, wherein the system is a vehicle model and the predictionmodel is a vehicle path and a velocity tracking model; S2: building aparallel computing architecture for the model prediction control of theprediction model and the target function and employing a triggeringparallel computing method by the parallel computing architecture tosynchronously compute the prediction model and the target function; andS3: solving and computing a gradient with a manner of a back propagationand using a gradient descent method to optimize a control amount of thesystem and realize a real time optimal control of the system; wherein acontrol objective of the vehicle path and the velocity tracking modelis: rapidly and accurately tracking a vehicle longitudinal velocityv_(x) and a lateral displacement Y, and setting a control time domainand a prediction time domain both as N and the target function as${\min\limits_{U}J} = {{\sum\limits_{i = 0}^{N - 1}\left( {{x_{i}^{T}Qx_{i}} + {u_{i}^{T}Ru_{i}}} \right)} + {x_{N}^{T}Px_{N}}}$wherein x_(i) is a state amount of a step i at a present moment, u_(i)is a system control amount of the step i at the present moment, Q is apositive weight matrix, P is a positive terminal penalty matrix and R isa positive control amount penalty matrix; wherein in the parallelcomputing architecture for the model prediction control in the step S2,a symbol indicating that a solution of the prediction model and thetarget function in a present step has been completed is used as thesymbol of starting a prediction computing at a next step, therebyrealizing parallel computing of the prediction model and the targetfunction; wherein the step S3 specifically comprises: S31: building aplurality of computing nodes, and setting one storage unit for each ofthe computing nodes, the storage unit storing a related computingparameter; S32: obtaining the gradient of the target function for aninput amount based on a back propagation according to the relatedcomputing parameter in the plurality of computing nodes; and S33: usingthe gradient descent method to optimize the control amount of thesystem, and obtaining an optimal control sequence, thereby realizingparallel prediction control of the system; wherein the step S33specifically comprises: using the gradient descent method to optimizethe control amount:

_(k|k),

_(k−1|k) . . .

_(k+N−1|k), wherein

_(k|k),

_(k+1|k) . . .

_(k+N−1|k) is a control amount in step 0, 1 . . . N−1 within a moment k,completing an optimization process when one of optimization conditionsis satisfied, thereby obtaining the optimal control sequence U*_(k):U* _(k)=[

*_(k|k),

*_(k+1|k) . . .

*_(k+N−1|k)], wherein

*_(k|k),

*_(k+1|k) . . .

*_(k+N−1|k) is a desired value of a control amount in step 0, 1 . . .N−1 within moment k, using a first element

*_(k|k) in the obtained optimal control sequence U*_(k) as a controlamount at moment k, and a new control sequence consisting of a zeroelement added after an element subsequent to the first element as aninitial value of a prediction control input matrix at moment k+1, i.e.U_(0|k+1)=[

*_(k+1|k),

*_(k+2|k) . . .

*_(k+N−1|k),0], and ending an prediction and optimization process atmoment k, and repeating the above steps to complete a prediction andoptimization process at the moment k+1; wherein an optimizationcondition is that a difference value between the target function of apresent iterative step size and the target function of a previous stepis smaller than a set value or reaches limited optimization times or achanging amount of the target function is
 0. 2. The method for the realtime optimization and the parallel computing of the model predictioncontrol based on the computing chart according to claim 1, wherein arecurrence relationship between the prediction model and the targetfunction is: $\begin{matrix}{i = 0} & {J_{0} = {\sum\limits_{i = 0}^{N - 1}{\Delta u_{{k + i}❘k}^{T}R\Delta u_{{k + i}❘k}}}} & {x_{{k + 1}❘k} = {f\left( {x_{k❘k},u_{k❘k}} \right)}} \\{i = 1} & {J_{1} = {J_{0} + {x_{{k + 1}❘k}^{T}{Qx}_{{k + 1}❘k}}}} & {x_{{k + 2}❘k} = {f\left( {x_{{k + 1}❘k},u_{{k + 1}❘k}} \right)}} \\ & \vdots & \\{i = {N - 1}} & {J_{N - 1} = {J_{N - 2} + {x_{{k + N - 1}❘k}^{T}{Qx}_{{k + N - 1}❘k}}}} & {x_{{k + N}❘k} = {f\left( {x_{{k + N - 1}❘k},u_{{k + N - 1}❘k}} \right)}} \\{i = N} & {J = {J_{N - 1} + {x_{{k + N}❘k}^{T}{Px}_{{k + N}❘k}}}} & \end{matrix}$ J wherein is the target function, ƒ is the predictionmodel of the system, x_(k+i|k) is the system state amount in a step i ata moment k and u_(k+i|k) is a system control amount in the step i at themoment k.
 3. The method for the real time optimization and the parallelcomputing of the model prediction control based on the computing chartaccording to claim 1, wherein a computing formula of an optimal controlsequence is: $\begin{matrix}{u_{k❘k}^{*} = {u_{{k - 1}❘{k - 1}}^{*} - {\frac{\partial J}{\partial u_{k❘k}}\Delta t}}} \\{u_{{k + 1}❘k}^{*} = {u_{k❘k}^{*} - {\frac{\partial J}{\partial u_{{k + 1}❘k}^{*}}\Delta t}}} \\ \vdots \\{u_{{k + N - 1}❘k}^{*} = {u_{{k + N - 2}❘k}^{*} - {\frac{\partial J}{\partial u_{{k + 1}❘k}^{*}}\Delta t}}}\end{matrix},$ wherein u*_(k+i|k) is a desired value of the controlamount of a step i at a moment k, u*_(k−1|k−1) is an optimal controlamount of a previous moment and Δt is a control step size.
 4. The methodfor the real time optimization and the parallel computing of the modelprediction control based on the computing chart according to claim 1,wherein the target function is decomposed as follows upon beingcomputed: $\begin{matrix}{J_{0} = {{g(U)} = {\sum\limits_{i = 0}^{N - 1}{u_{i}^{T}Ru_{i}}}}} \\{J_{i} = {{h\left( {y_{i},J_{i - 1}} \right)} = {J_{i - 1} + {\left( {y_{i} - y_{r}} \right)^{T}{Q\left( {y_{i} - y_{r}} \right)}}}}} \\{{= {\left( {x_{ji} - x_{jr}} \right)^{T}{Q\left( {x_{ji} - x_{jr}} \right)}}},{j = 1},6,{i = 1},2,\ldots,N}\end{matrix}$ wherein g and h are respectively a decomposition computingfunction.